package it.uniroma2.art.coda.structures.depends;

/**
 * This class is used when we have a dependency with two parameters
 * 
 * @author Andrea Turbati
 * 
 */
public class DependencyObjVarParam extends DependencyObject {

	String [] values;
	

	/**
	 * @param ruleId
	 *            the projection rule id that it is pointed by this dependency
	 * @param dependsOnType
	 *            the dependency type
	 * @param isExtDepADependsOn
	 *            true if this dependency is a dependsOn, false otherwise
	 * @param isDynRef
	 *            true if this a dynamic dependency, false otherwise
	 * @param values
	 *            the list/array of values present in this dependency 
	 */
	public DependencyObjVarParam(String ruleId, String dependsOnType, boolean isExtDepADependsOn, boolean isDynRef, String... values) {
		super(ruleId, dependsOnType, isExtDepADependsOn, isDynRef);
		this.values = new String[values.length];
		for(int i=0; i<values.length; ++i){
			this.values[i] = values[i];
		}
	}

	public String getValueAtPost(int i){
		if(i>=values.length){
			return null;
		}
		else
			return values[i];
	}
	
	public String[] getValuesArray(){
		return values;
	}

}
